#include "sys.h"

void get_timestring(char* buf)
{
    struct tm *p, tm_p;
    time_t timep;

    time(&timep);
    localtime_r(&timep, &tm_p);
    p = &tm_p;
    sprintf(buf, "%d-%02d-%02d %02d:%02d:%02d",
        1900 + p->tm_year, 1 + p->tm_mon, p->tm_mday, p->tm_hour, p->tm_min, p->tm_sec);
}

